package ${packageName}.controller.rent;

import javax.annotation.Resource;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.RequestBody;
import ${packageName}.pojo.req.${addReqDto};
import ${packageName}.pojo.req.${updateReqDto};
import ${packageName}.pojo.req.${queryPageReqDto};
import ${packageName}.pojo.resp.${queryResDto};
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.eco.common.commonbase.mybatis.PageParam;
import java.util.List;

import ${packageName}.service.${serviceName};

/**
 * ${tableComment}
 */
@RestController
@RequestMapping("/${entityNameLower}")
public class ${controllerName} {

	@Resource
	private ${serviceName} ${serviceNameLower};

	/**
	 * 分页查询${tableComment}
	 */
	@GetMapping("/page")
	public IPage<${queryResDto}> query${entityName}Page(PageParam<${queryPageReqDto}> pageParam){
		return ${serviceNameLower}.query${entityName}Page(pageParam);
	}

	/**
	 * 保存${tableComment}
	 */
	@PostMapping("/save")
	public Boolean save(@RequestBody ${addReqDto} reqDto) {
		return ${serviceNameLower}.add${entityName}(reqDto);
	}

	/**
	 * 修改${tableComment}
	 */
	@PostMapping("/update")
	public Boolean update(@RequestBody ${updateReqDto} reqDto) {
		return ${serviceNameLower}.update${entityName}(reqDto);
	}

	/**
	 * 批量删除${tableComment}
	 */
	@PostMapping("/deleteBatch")
	public Boolean deleteBatch(@RequestBody List<Long> ids) {
		return ${serviceNameLower}.deleteBatch(ids);
	}

}